from pagemagic.decorators import render_to
import urllib2

@render_to('pagemagic/text_preview.html')
def text_preview(request):
    text = request.POST.get('text', '')
    text = urllib2.unquote(text)
    return {
        'text': text,
        'autoformat': request.POST.get('autoformat', False),
    }
